import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询所有商品分类
export function listWithTree(query) {
  return request({
    url: '/cloudmallproduct/category/list',
    method: 'get',
    params: query
  })
}

// 添加商品分类
export function addCategory(data) {
  return request({
    url: '/cloudmallproduct/category/add',
    method: 'post',
    data: data
  });
}

// 修改商品分类
export function updateCategory(data) {
  return request({
    url: '/cloudmallproduct/category/edit',
    method: 'put',
    data: data
  });
}

// 逻辑删除商品分类
export function logicRemoveByIds(catIds){
   return request({
    url: `/cloudmallproduct/category/${catIds.join(',')}`,
    method: 'delete'
   })
}